]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
grabHelper: Make sure to return not null when the stack contains fake grabs
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 19 Aug 2012 23:12:02 +0000 (19:12 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 Aug 2012 01:15:52 +0000 (21:15 -0400)
We did this if there's nothing in the grab stack, but didn't do this
when there's no real grabs in the grab stack.

js/ui/grabHelper.js

index 4a72351bbd53824a776fd2222b356c42a2aaf945..ac65351280fbf9e8e9f407f170490a7b721641a1 100644 (file)
@@ -84,14 +84,11 @@ const GrabHelper = new Lang.Class({
     },
 
     get currentGrab() {
-        if (!this._grabStack.length)
-            return {};
-
         let idx = this._grabStack.length - 1;
         while (idx >= 0 && this._grabStack[idx].untracked)
             idx--;
 
-        return this._grabStack[idx];
+        return this._grabStack[idx] || {};
     },
 
     _findStackIndex: function(actor) {